<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
namespace App\Config\Request;

use Mine\MineFormRequest;

/**
 * 饰品列表验证数据类
 */
class ConfigProductRequest extends MineFormRequest
{
    /**
     * 公共规则
     */
    public function commonRules(): array
    {
        return [];
    }

    
    /**
     * 新增数据验证规则
     * return array
     */
    public function saveRules(): array
    {
        return [
            //类型(1.csgo,2.商品) 验证
            'souce_type' => 'required',
            //销售价格 验证
            'price' => 'required',
            //采购价格 验证
            'origin_price' => 'required',
            //人民币价格 验证
            'rmb_price' => 'required',
            //库存 验证
            'stock' => 'required',

        ];
    }
    /**
     * 更新数据验证规则
     * return array
     */
    public function updateRules(): array
    {
        return [
            //类型(1.csgo,2.商品) 验证
            'souce_type' => 'required',
            //销售价格 验证
            'price' => 'required',
            //采购价格 验证
            'origin_price' => 'required',
            //人民币价格 验证
            'rmb_price' => 'required',
            //库存 验证
            'stock' => 'required',

        ];
    }

    
    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'id' => 'ID',
            'souce_type' => '类型(1.csgo,2.商品)',
            'price' => '销售价格',
            'origin_price' => '采购价格',
            'rmb_price' => '人民币价格',
            'name' => '产品名称',
            'stock' => '库存',
            'created_by' => '创建者',

        ];
    }

}